import axios from 'axios'

export default {
  state: {
    list: []
  },
  getters: {},
  mutations: {
    SET_LIST(state, payload) {
      state.list = payload
    }
  },
  actions: {
    async getList({commit}) {
      const {data} = await axios({
        method: 'GET',
        url: 'http://localhost:3000/news'
      })
      commit('SET_LIST', data)
    }
  },
  namespaced: true,
}


